import React from 'react';
import { Pagination } from 'antd';
import styles from './PaginationCommon.less';

const PaginationCommon = (props) => {
  const { style, pageSize = 10, defaultPageSize, ...rest } = props;
  return (
    <Pagination
      className={styles.root}
      showTotal={(total, range) => `总共${total}条记录，共${Math.ceil(total / (pageSize || defaultPageSize))}页`}
      defaultPageSize={20}
      defaultCurrent={1}
      showQuickJumper
      pageSize={pageSize}
      style={{ ...style }}
      {...rest}
    />
  );
};

export default PaginationCommon;
